package com.lhkj.ct.meta.modules.report.word.personal;

import com.lhkj.ct.meta.modules.gauge.common.enums.ReportLayout;
import com.lhkj.ct.meta.modules.psychology.model.vo.PersonalReportInfo;
import com.lhkj.ct.meta.modules.report.AbstractReportHandle;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

/**
 * <p>
 * 描述
 * </p>
 *
 * @author job
 * @since 2023/10/22
 */
public class PersonalReportHandle extends AbstractReportHandle<PersonalReportInfo, XWPFDocument> {

    private final BaseLayoutHandler<PersonalReportInfo> baseLayoutHandler;

    public PersonalReportHandle(ReportLayout layout) {
        if (layout == ReportLayout.CONVENTION) {
            baseLayoutHandler = new NormLayoutHandler();
        }else{
            baseLayoutHandler = new StandardReportHandle();
        }
    }

    @Override
    public XWPFDocument generateReport(PersonalReportInfo data) {
        return baseLayoutHandler.build(data);
    }
}
